<<<<<<< HEAD
{include file="public:head" /}
<div class="nav footer fixed-bar" data-trackid="全站-底部导航">
    <a href="/"  data-trackid="全站-底部导航-首页">首页</a>
    <a href="/category.html" class="on" data-trackid="全站-底部导航-分类">分类</a>
    <a href="/cart/0" data-trackid="全站-底部导航-购物车">购物车</a>
    <a href="/myself.html" data-trackid="全站-底部导航-我">我的</a>
</div><!-- //底部导航结束 -->
<style>
    * { touch-action: none; }
</style>
<div class="content">
    <div id="cate-content">
        <div class="m-cate-menu">
            <div class="scroll-wapper" id="scroll1" >
                <ul class="scroller" id="cate-menu">
                    {volist name="category" id="vo"}
                    {if condition = "$vo.id eq $max_category"}
                    <li id="cate-{$vo.id}" class="on" catid="{$vo.id}" data-load="0">
                        <span>{$vo.name}</span>
                    </li>
                    {else /}
                    <li id="cate-{$vo.id}" catid="{$vo.id}" data-load="0">
                        <span>{$vo.name}</span>
                    </li>
                    {/if}
                    {/volist}
                </ul>
                <div class="cate-bg"></div>
            </div>
        </div>
        <div class="m-cate-main">
            <div class="scroll-wapper" id="scroll2">
                <div class="scroller">
                    <!--div-->
                    <div class="mode-10"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/js/zepto.min.js"></script>
<script src="__STATIC__/js/base.min.js"></script>
<script src="__STATIC__/js/cate.js"></script>
<script src="__STATIC__/js/shopin.js"></script>
<script src="__STATIC__/js/fast.js"></script>
<script>
    function toUrl(url) {
        window.location.href = url;
    }
    FastClick.attach(document.body);
</script>
<script src="__STATIC__/js/jquery-3.1.1.min.js"></script>
<script>
    $.noConflict();
    jQuery('#cate-menu li').click(function(){
        var that = jQuery(this);
        var cat_id = that.attr('catid');
        getInfo(that, cat_id);
    });
    function getInfo(that, cat_id) {
        if(that.attr('data-load') == 1) {
            // 已经加载过
//            jQuery('#container_id div ul li').find(".swiper-lazy-loaded").removeClass('swiper-lazy-loaded');
//            jQuery('#container_id div[data-trackid="' + cat_id + '"]').addClass('swiper-slide-active');
//            var img_list = jQuery('#container_id div[data-trackid="' + cat_id + '"] img');
//            for (var i = 0; i < img_list.length; i++) {
//                var src = img_list[i].dataset.srcString;
//                jQuery(img_list[i]).attr('data-src', src);
//            }
        } else {
            jQuery.ajax({
                type : "get",
                dataType : 'json',
                data:{
                    id : cat_id
                },
                url : "/category/getCategoryInfo",
                async : true,
                success:function(data){
                    var rows = data.data;
                    var name = jQuery('#cate-' + cat_id + ' span').html();
                    if(rows){
                        that.attr('data-load', 1);
                        var div = '<div class="m-cate-info" id="sub-' + cat_id + '">' +
                            '<h4>' + name + '</h4>' +
                            '<div class="m-group">' +
                            '</div>' +
                            '</div>';
                        jQuery('#scroll2 div[class="scroller"]').append(div);
                        jQuery('#scroll2 div[class="m-cate-info"]').find(".dn").addClass('dn');
                        jQuery('#sub-' + cat_id).removeClass('dn');
                        for (var i = 0; i < rows.length; i++) {
                            var a = '<a class="a-item" href="javascript:toUrl(\'product/info?id=' + rows[i].id + '\');">' +
                                '<img data-url="' + rows[i].url + '" class="ware-img" src="' + rows[i].url + '">' +
                                '<span class="ellips">' + rows[i].name + '</span>' +
                                '</a>';
                            jQuery('#sub-' + cat_id + ' div').append(a);
                        }
                    }
                },
                error:function(error){
                    //异常处理；
                    console.log(error);
                }
            });
        }
    }
    $('#cate-{$max_category}').click();
</script>
</body>
=======
{include file="public:head" /}
<div class="nav footer fixed-bar" data-trackid="全站-底部导航">
    <a href="/"  data-trackid="全站-底部导航-首页">首页</a>
    <a href="/category.html" class="on" data-trackid="全站-底部导航-分类">分类</a>
    <a href="/cart/0" data-trackid="全站-底部导航-购物车">购物车</a>
    <a href="/myself.html" data-trackid="全站-底部导航-我">我的</a>
</div><!-- //底部导航结束 -->
<style>
    * { touch-action: none; }
</style>
<div class="content">
    <div id="cate-content">
        <div class="m-cate-menu">
            <div class="scroll-wapper" id="scroll1" >
                <ul class="scroller" id="cate-menu">
                    {volist name="category" id="vo"}
                    {if condition = "$vo.id eq $max_category"}
                    <li id="cate-{$vo.id}" class="on" catid="{$vo.id}" data-load="0">
                        <span>{$vo.name}</span>
                    </li>
                    {else /}
                    <li id="cate-{$vo.id}" catid="{$vo.id}" data-load="0">
                        <span>{$vo.name}</span>
                    </li>
                    {/if}
                    {/volist}
                </ul>
                <div class="cate-bg"></div>
            </div>
        </div>
        <div class="m-cate-main">
            <div class="scroll-wapper" id="scroll2">
                <div class="scroller">
                    <!--div-->
                    <div class="mode-10"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/js/zepto.min.js"></script>
<script src="__STATIC__/js/base.min.js"></script>
<script src="__STATIC__/js/cate.js"></script>
<script src="__STATIC__/js/shopin.js"></script>
<script src="__STATIC__/js/fast.js"></script>
<script>
    function toUrl(url) {
        window.location.href = url;
    }
    FastClick.attach(document.body);
</script>
<script src="__STATIC__/js/jquery-3.1.1.min.js"></script>
<script>
    $.noConflict();
    jQuery('#cate-menu li').click(function(){
        var that = jQuery(this);
        var cat_id = that.attr('catid');
        getInfo(that, cat_id);
    });
    function getInfo(that, cat_id) {
        if(that.attr('data-load') == 1) {
            // 已经加载过
//            jQuery('#container_id div ul li').find(".swiper-lazy-loaded").removeClass('swiper-lazy-loaded');
//            jQuery('#container_id div[data-trackid="' + cat_id + '"]').addClass('swiper-slide-active');
//            var img_list = jQuery('#container_id div[data-trackid="' + cat_id + '"] img');
//            for (var i = 0; i < img_list.length; i++) {
//                var src = img_list[i].dataset.srcString;
//                jQuery(img_list[i]).attr('data-src', src);
//            }
        } else {
            jQuery.ajax({
                type : "get",
                dataType : 'json',
                data:{
                    id : cat_id
                },
                url : "/category/getCategoryInfo",
                async : true,
                success:function(data){
                    var rows = data.data;
                    var name = jQuery('#cate-' + cat_id + ' span').html();
                    if(rows){
                        that.attr('data-load', 1);
                        var div = '<div class="m-cate-info" id="sub-' + cat_id + '">' +
                            '<h4>' + name + '</h4>' +
                            '<div class="m-group">' +
                            '</div>' +
                            '</div>';
                        jQuery('#scroll2 div[class="scroller"]').append(div);
                        jQuery('#scroll2 div[class="m-cate-info"]').find(".dn").addClass('dn');
                        jQuery('#sub-' + cat_id).removeClass('dn');
                        for (var i = 0; i < rows.length; i++) {
                            var a = '<a class="a-item" href="javascript:toUrl(\'product/info?id=' + rows[i].id + '\');">' +
                                '<img data-url="' + rows[i].url + '" class="ware-img" src="' + rows[i].url + '">' +
                                '<span class="ellips">' + rows[i].name + '</span>' +
                                '</a>';
                            jQuery('#sub-' + cat_id + ' div').append(a);
                        }
                    }
                },
                error:function(error){
                    //异常处理；
                    console.log(error);
                }
            });
        }
    }
    $('#cate-{$max_category}').click();
</script>
</body>
>>>>>>> 93c40d8086b7a8d5a9aa3548fdc8eb06a4272cf7
</html>